package com.ruoyi.web.controller.common;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

@Controller
public class CasErrorController {

    @GetMapping("/casError")
    @ResponseBody
    public Map<String, Object> handleError(HttpServletRequest request) {
        Map<String, Object> error = new HashMap<>();
        error.put("code", request.getParameter("error_code"));
        error.put("message", request.getParameter("error_message"));
        return error;
    }
}